import { create } from 'dva-core';
import createLoading from 'dva-loading';

function createDva() {
  const dvaApp = create();
  dvaApp.use(createLoading());
  dvaApp.use({
    onError(_err: any) {
      // 
    }
  });
  require('@/models').default.forEach((item: any) => {
    dvaApp.model(item.default);
  });
  dvaApp.start();
  return dvaApp;
}

export const store = createDva()._store;